<?php use_helper('I18N', 'Date', 'Text') ?>
<?php include_partial('beca/assets') ?>


<div id="sf_admin_container">
  <h1>Becas Disponibles</h1>
  <?php include_partial('beca/flashes');  

  foreach($categorias as $cat): ?>
  <h3><?= $cat?></h3>
  <?php foreach($cat->getBecasEnInscripcion() as $b): ?>
      <div class="becaDisponible">
        <div class="becaTitulo"><?=$b->getNombre()?></div>
        <strong>Inscribe hasta:</strong><?=$b->getDateTimeObject('fecha_limite_inscripcion')->format('d-m-Y')?><br />
        <?php echo simple_format_text($b->getDescripcion()) ?>
        <ul class="becaOpciones">
     <?php if($sol = $b->getSolicitudPara($sf_user->getAlumnoId())) {?>
                 <li class="sf_admin_action_edit">
                   <?php echo link_to('Editar','solicitud_edit', array('id' => $sol->getId() )) ?>
                 </li>
     <?php } elseif($b->puedeSolicitar($sf_user->getAlumnoId())) { ?>
               <li class="sf_admin_action_agregar_solicitud">
                 <?php echo link_to('Solicitar','beca_solicitar', array('id' => $b->getId() )) ?>
               </li>
     <?php }?>
          </li>
          <li class="sf_admin_action_list">
          <?php echo link_to('Ver...','beca/ListShow?id='.$b->getId())?>
          </li>
        </ul>
      </div>
  <?php endforeach;  
  endforeach;?>
</div>
